{include file="index/header" /}
<body style="background-color:#f2f9fd;">
	<div class="header bg-main">
		<div class="logo margin-big-left fadein-top">
			<h1><img src="__PUBLIC__/images/y.jpg" class="radius-circle rotate-hover" height="50" alt="" />后台管理中心</h1>
		</div>
		<div class="head-l">
			<a class="button button-little bg-green" href="/" target="_blank"><span class="icon-home"></span> 前台首页</a> &nbsp;&nbsp;
			<a class="button button-little bg-green" href="javascript:;" onclick="cacheclear()" onclick="if(confirm('确定清除?')==false)return false;"><span class="icon-trash-o"></span> 清除缓存</a>&nbsp;&nbsp; 
			<a class="button button-little bg-red" onclick="logout()" href="javascript:;"><span class="icon-power-off"></span> 退出登录</a> {if $admin.admin_id eq 1}<font color="#fff" >用户数 <b>{$count}</b></font>  &nbsp;&nbsp;&nbsp;<font color="#fff" >教程总数 <b>{$course_count}</b></font>{/if}
		</div>
	</div>
	<div class="leftnav">
		<div class="leftnav-title"><strong><span class="icon-list"></span>菜单列表</strong></div>
		{foreach $data as $k=>$v}
		<h2><span class="{if $k eq 0} icon-user {else} icon-pencil-square-o {/if}"></span>{$v.privilege_name}</h2>
		<ul {if $k eq 0} style="display:block" {/if}>
			{foreach name='v.son' item='v1'}
			<li><a href="/atxunda/{$v1.controller_name}/{$v1.action_name}" target="right"><span class="icon-caret-right"></span>{$v1.privilege_name}</a></li>
			{/foreach} 
		</ul> 
		{/foreach}
	</div>
	<script type="text/javascript">
		$(function(){
			$(".leftnav h2").click(function(){
				$(this).next().slideToggle(200);	
				$(this).toggleClass("on"); 
			})
			$(".leftnav ul li a").click(function(){
				var Cts = $('.bread').html();
				if(Cts.indexOf($(this).text()) <= 0){
					$('#a_leader_txt').after('<li><a href="'+$(this).attr('href')+'" target="right" class="a_leader_txt">'+$(this).text()+'</a></li>');
				}
				$(".leftnav ul li a").removeClass("on");
				$(this).addClass("on");
			})
		});
		function logout() {
			if(window.confirm('您确定要退出吗？')) {
				top.location = "{:url('login/logout')}";
			}
		}
		function cacheclear() {
			var index = '';
			$.ajax({
				url:"{:url('common/cacheclear')}",
				beforeSend:function(obj)
				{
					index = layer.load();
				},
				success:function(obj)
				{
					layer.close(index);
					layer.msg('清除成功');
				},
			})
		}
	</script>
	<ul class="bread">
		<li><a href="{:url('index/info')}" target="right" class="icon-home"> 首页</a></li>
		<li><a href="##" id="a_leader_txt">网站信息</a></li>
		<li>
			<b>当前语言：</b><span style="color:red;">中文</span>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;切换语言：<a href="##">中文</a> &nbsp;&nbsp;<a href="##">英文</a> 
		</li>
	</ul>
	<div class="admin">
		<iframe scrolling="auto" rameborder="0" src="{:url('user/index')}" name="right" width="100%" height="100%"></iframe>
	</div>
</body>
</html>